<?php
/**
 * 1. 定义常量
 * 2. 加载函数库
 * 3. 启动框架
 */
$time = microtime();
define("YING", realpath(' /'));
define("CORE", YING.'core');
define("APP", YING.'app');
define("DEBUG", true);
define('MODULE', 'app');

include "vendor/autoload.php";

if(DEBUG){
    $whoops = new \Whoops\Run;
    $errorTitle = '框架出错了';
    $option = new \Whoops\Handler\PrettyPageHandler();
    $option->setPageTitle($errorTitle);
    $whoops->pushHandler($option);
    $whoops->register();
    ini_set('display_error', 'On');
}else{
    ini_set('display_error', 'off');
}


include CORE.'/common/function.php';

include CORE.'/ying.php';

spl_autoload_register('\core\ying::load');

\core\ying::run();